package com.kehutong.charge.util.enums;

import org.coraframework.util.HashID;

import java.util.HashMap;

/**
 * @program: kht
 * @description: 欠费类型设置枚举
 * @author: jian Ye
 * @create: 2021/8/12
 **/
public enum ArrearsSetTypeEnum implements HashID {


    THIS_MONTH("1", "当月"),
    PAST_AND_PRESENT("2", "当月+往月"),
    ;

    private final String id;
    private final String desc ;



    private ArrearsSetTypeEnum(String id, String desc) {
        this.id = id;
        this.desc = desc ;
    }



    public static String getEnumDesc(String id){
        for (ArrearsSetTypeEnum enums : values()) {
            if (enums.id.equals(id)) {
                return enums.desc;
            }
        }
        return "";
    }


    /**
     * 获取map集合
     * @return
     */
    public static HashMap<String,String> getMap() {
        HashMap<String, String> map = new HashMap<>();
        for (ArrearsSetTypeEnum enums : values()) {
            map.put(enums.id, enums.desc);
        }
        return map;
    }



    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
